angular.module('user_login',[])
    .controller('user_loginCtrl', function ($rootScope, $scope, $state, httpUtil, alertModule) {
        $scope.user = {
            username: "",
            password: ""
        };

        $scope.userLogin = function () {
            var params = $scope.user;
            if(params.username == null || params.username == "" || params.password == null || params.password == ""){
                alertModule.alertMessage("用户名和密码不能为空！");
                return false;
            }
            httpUtil.httpSend("User_userLogin.action", params, function (data) {
                $rootScope.user = data.data;
                $state.go('main.music_information');
            });
        };
    });